package com.turman.common.ui.component

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.fragment.app.Fragment

/**
* fragment基类
* @author buobao
* @since 2024/3/12 9:05
*/
abstract class BaseFragment:Fragment() {
    protected lateinit var layoutView:View

    @LayoutRes
    abstract fun getLayoutId():Int

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        layoutView = inflater.inflate(getLayoutId(),null)
        init()
        return layoutView
    }

    open protected fun init(){}
}